﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="m_groups.ascx.cs" Inherits="administrator_uc_admin_m_groups" %>
<%@ Register src="~/administrator/uc_admin/mn_top.ascx" tagname="mn_top" tagprefix="uc1" %>
<%@ Register src="~/administrator/uc_admin/mn_bottom.ascx" tagname="mn_bottom" tagprefix="uc2" %>
<div id="managecontent">
    <div id="managecontent_title">
        <h3>QUẢN LÝ DANH MỤC NHÓM NGƯỜI DÙNG</h3>
    </div>
    <br class="clrfix" />
    <div id="managecontent-header">
        <div id="managecontent_feature">
        <script language="javascript">
            function CallFuncEditItem() {
                document.getElementById('<%= btnEditItem.ClientID%>').click();
            }
            function CallFuncDeleteItem() {
                if (confirm('Bạn có muốn xóa không?')) {
                    document.getElementById('<%= btnDeleteItem.ClientID%>').click();
                }
            }
        </script>
        <uc1:mn_top ID="mn_top" runat="server" />
        </div>                
        <div id="managecontent_search">
            <asp:Literal ID="ltresultSearch" runat="server"></asp:Literal>
            <asp:TextBox ID="txtKeyWord" runat="server"></asp:TextBox>
            <asp:LinkButton ID="lbtSearch" runat="server"            
                onclick="lbtSearch_Click"> <img src="../images/icons/icon_search.gif" border="0px" /><b>Tìm Kiếm</b> </asp:LinkButton>
        </div>
    </div>
    <br class="clrfix" />
    <asp:GridView ID="gv_ManageControl" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="GroupID" Width="910px" AllowPaging="True"
        onpageindexchanging="gv_ManageControl_PageIndexChanging" PageSize="20" 
        AllowSorting="True" onsorting="gv_ManageControl_Sorting">
        <Columns>
             <asp:TemplateField > 
                <HeaderTemplate>
                    <input id="checkAll" style="float:left;" onclick="javascript:SelectAllCheckBoxes(this);" 
                          runat="server" type="checkbox" />
                </HeaderTemplate>            
                <ItemTemplate>
                    <asp:CheckBox ID="chkCheck" runat="server" />
                    <asp:HiddenField ID="hdItemKeyFieldID" runat="server" Value='<%#Bind("GroupID") %>' />
                </ItemTemplate>
             </asp:TemplateField>                  
             <asp:BoundField DataField="GroupName" HeaderText="Nhóm người dùng" SortExpression="GroupName" />     
             <asp:BoundField DataField="Description" HeaderText="Mô tả" />     
             <asp:BoundField DataField="_IsAdmin" HeaderText="Thuộc nhóm Quản trị" SortExpression="IsAdmin" />              
            <asp:TemplateField>
                <ItemStyle HorizontalAlign="Center" Width="30px" />
            <ItemTemplate> 
                 <a href="javascript:RedirectUrl('m_groupmodule','Redirect','<%# Eval("GroupID") %>');" title="Phân quyền chức năng nhóm: <%# Eval("GroupName") %>"><img src="../images/icons/icon_settings.png" border="0px"/></a>            
            </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemStyle HorizontalAlign="Center" Width="30px" />
            <ItemTemplate> 
                 <a href="javascript:RedirectUrl('m_leftmenugroup','Redirect','<%# Eval("GroupID") %>');" title="Quản lý Menu truy cập nhóm: <%# Eval("GroupName") %>"><img src="../images/icons/icon_managemenu.jpg" border="0px"/></a>            
            </ItemTemplate>
            </asp:TemplateField>            
            <asp:TemplateField>
                <ItemStyle HorizontalAlign="Center" Width="30px" />
            <ItemTemplate> 
                 <a href="javascript:RedirectUrl('m_groupuser','Redirect','<%# Eval("GroupID") %>');" title="Quản lý User nhóm: <%# Eval("GroupName") %>"><img src="../images/icons/icon_manageuser.jpg" border="0px"/></a>            
            </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Sửa">
                <ItemStyle HorizontalAlign="Center" Width="30px" />
            <ItemTemplate> 
                 <a href="javascript:EditItem('e_groups','EditItem','<%# Eval("GroupID") %>','530','200');" title="Sửa"><img src="../images/icons/icon_edit.bmp" border="0px"/></a>            
            </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Xóa">
            <ItemStyle HorizontalAlign="Center" Width="30px" />
            <ItemTemplate>
                 <a href="javascript:DeleteItem('tbl_Groups','GroupID','','<%# Eval("GroupID") %>', '<%# Eval("GroupName") %>','2');" title="Xóa"><img src="../images/icons/icon_delete.jpg" border="0px"/></a>                        
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="Silver" />
        <HeaderStyle Font-Bold="True" BackColor="Silver" Font-Size="14px" 
            Height="26px" />
        <PagerSettings FirstPageText="trang đầu-" LastPageText="-trang cuối" 
            Mode="NumericFirstLast" NextPageText="-trang sau-" 
            PreviousPageText="-trang trước-" Position="TopAndBottom" />
        <PagerStyle BackColor="Silver" />
        <RowStyle Height="25px" CssClass="rowStyle" />
    </asp:GridView>
    <br class="clrfix" />
    <div id="AddNewItem">
        <uc2:mn_bottom ID="mn_bottom" runat="server" />
        <asp:HiddenField ID="hdItemID" runat="server" />
        <asp:Button ID="btnEditItem" runat="server" CssClass="featurehidden" onclick="btnEditItem_Click" />
        <asp:Button ID="btnDeleteItem" runat="server" CssClass="featurehidden" onclick="btnDeleteItem_Click" />
    </div>
</div>